Option Strict On

Public Class frmVirBldg
  Inherits System.Windows.Forms.Form

  Private Const APARTMENT As Integer = 0
  Private Const COMMERCIAL As Integer = 1
  Private Const HOME As Integer = 2

  ' Kod generowany przez Windows Form Designer 


  Private Sub frmBuilding_Load(ByVal sender As System.Object, ByVal e As _
                 System.EventArgs) Handles MyBase.Load

  End Sub

  Private Sub btnExit_Click(ByVal sender As System.Object, ByVal e As _
                 System.EventArgs) Handles btnExit.Click
    Me.Dispose()
  End Sub

  Private Sub btnProperties_Click(ByVal sender As Object, ByVal e As _
                  System.EventArgs) Handles btnProperties.Click
    Dim CurrentBuilding As Building

    Dim MyApartment As New Apartment("6 North Ben Street", 550000, 6000, _
                         12000, APARTMENT, "555-1000")
    Dim MyBuilding As New Commercial("250 Industrial Drive", 320000, 3800, _
                         5800, COMMERCIAL, "")
    Dim MyHome As New Home("2 Ghent Court", 140000, 1300, 3300, HOME, "")
    Dim delta As New Home()

    Dim MyInvestments As Building() = New Building() {MyApartment, _
                              MyBuilding, MyHome, delta}
    delta.SnowRemoval = "555-3333"

    For Each CurrentBuilding In MyInvestments
      txtOutput.Text &= CurrentBuilding.CallSnowRemoval & vbCrLf
    Next
    MyApartment.DisplayBuilding()
    MyBuilding.DisplayBuilding()
    MyHome.DisplayBuilding()
    delta.DisplayBuilding()
    Console.WriteLine(delta.CallSnowRemoval())

  End Sub
End Class
